<template>
   <div>
        <!-- <el-table :data="menuList" style="width: 100%" > -->
        <el-table :data="userList" :header-cell-style="cellStyle" style="width: 100%;margin-bottom: 20px;" row-key="id"
            border :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
            <el-table-column prop="catename" label="分类名称" sortable width="180">
            </el-table-column>
            
            <el-table-column label="状态">
                <template slot-scope="scope">
                    <el-button size="mini" plain :type="scope.row.status == 1 ? 'success' : 'primary'">{{
                        scope.row.status
                            == 1 ? '启用' : '禁用'
                    }}</el-button>
                </template>
            </el-table-column>
        
          
            <el-table-column label="操作">
                <template slot-scope="scope">
                    <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
                    <el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
                </template>
            </el-table-column>
        </el-table>
    </div>
</template>

<script>
export default {
    props: ['userList', 'cellStyle'],
    data() {
        return {
            
        };
    },

    mounted() {
        
    },

    methods: {
        handleEdit(index, row) {
            // 通知父亲修改数据（子传父）==>form修改数据（父传子）
            this.$emit('edit', { index: index, row: row })
        },
        handleDelete(index, row) {
            // 通知父亲修改数据（子传父）
            this.$emit('remove', { index, row })
        }
    },
};
</script>

<style lang="less" scoped>

</style>